package weekMatch.two_102;

public class LeeCode_01 {
    public static void main(String[] args) {

    }
    private static int[] findColumnWidth(int[][] grid) {
        int m = grid.length;
        int n = grid[0].length;
        int[] ans = new int[n];
        for (int j = 0; j < n; j++) {
            for (int i = 0; i < m; i++) {
                int num = grid[i][j];
                int count = 0;
                if (num == 0){
                    count = 1;
                    if (count > ans[j]){
                        ans[j] = count;
                    }
                }
                if (num < 0)
                    count++;
                while (num != 0){
                    num /= 10;
                    count++;
                }
                if (count > ans[j]){
                    ans[j] = count;
                }
            }
        }
        return ans;
    }
}
